package io.github.wanggit.antrpc.console.service.utils;

import io.github.wanggit.antrpc.commons.bean.RegisterBeanMethod;

import java.util.ArrayList;

public abstract class RegisterBeanMethodUtil {

    public static RegisterBeanMethod copy(RegisterBeanMethod rbm) {
        RegisterBeanMethod bean = new RegisterBeanMethod();
        bean.setDurationInSeconds(rbm.getDurationInSeconds());
        bean.setLimit(rbm.getLimit());
        bean.setClassName(rbm.getClassName());
        bean.setMethodId(rbm.getMethodId());
        bean.setMethodName(rbm.getMethodName());
        bean.setParameterTypeNames(new ArrayList<>(rbm.getParameterTypeNames()));
        bean.setHumanFullName(rbm.getHumanFullName());
        return bean;
    }
}
